!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(require("@firebase/app")):"function"==typeof define&&define.amd?define(["@firebase/app"],t):t((e=e||self).firebase)}(this,function(re){"use strict";try{(function(){re=re&&re.hasOwnProperty("default")?re.default:re;var r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function e(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var i=function(){return(i=Object.assign||function(e){for(var t,n=1,r=arguments.length;ns[0]&&t[1]"})}(i,r):"Error",a=this.serviceName+": "+s+" ("+o+").",c=new l(o,a),u=0,d=Object.keys(r);us&&console.warn("This browser only supports "+s+" actions.The remaining actions will not be displayed."),[2,o.showNotification(r,n)];case 3:return this.bgMessageHandler?[4,this.bgMessageHandler(t)]:[3,5];case 4:return e.sent(),[2];case 5:return[2]}})})},Y.prototype.onSubChange_=function(e){return b(this,void 0,void 0,function(){var t,n,r,o;return v(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,this.getSWRegistration_()];case 1:return t=e.sent(),[3,3];case 2:throw n=e.sent(),T.create("unable-to-resubscribe",{errorInfo:n});case 3:return e.trys.push([3,5,,8]),[4,t.pushManager.getSubscription()];case 4:return e.sent(),[3,8];case 5:return r=e.sent(),[4,this.getTokenDetailsModel().getTokenDetailsFromSWScope(t.scope)];case 6:if(!(o=e.sent()))throw r;return[4,this.deleteToken(o.fcmToken)];case 7:throw e.sent(),r;case 8:return[2]}})})},Y.prototype.onNotificationClick_=function(i){return b(this,void 0,void 0,function(){var t,n,r,o;return v(this,function(e){switch(e.label){case 0:return i.notification&&i.notification.data&&i.notification.data[z]?i.action?[2]:(i.stopImmediatePropagation(),i.notification.close(),(t=i.notification.data[z]).notification&&(n=t.fcmOptions&&t.fcmOptions.link||t.notification.click_action)?[4,this.getWindowClient_(n)]:[2]):[2];case 1:return(r=e.sent())?[3,3]:[4,self.clients.openWindow(n)];case 2:return r=e.sent(),[3,5];case 3:return[4,r.focus()];case 4:r=e.sent(),e.label=5;case 5:return r?(delete t.notification,delete t.fcmOptions,o=Q(w.NOTIFICATION_CLICKED,t),[2,this.attemptToMessageClient_(r,o)]):[2]}})})},Y.prototype.getNotificationData_=function(e){var t;if(e&&"object"==typeof e.notification){var n=i({},e.notification);return n.data=i({},e.notification.data,((t={})[z]=e,t)),n}},Y.prototype.setBackgroundMessageHandler=function(e){if(!e||"function"!=typeof e)throw T.create("bg-handler-function-expected");this.bgMessageHandler=e},Y.prototype.getWindowClient_=function(i){return b(this,void 0,void 0,function(){var t,n,r,o;return v(this,function(e){switch(e.label){case 0:return t=new URL(i,self.location.href).href,[4,J()];case 1:for(n=e.sent(),r=null,o=0;o